Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python-side fix for expecting NaN in JSON #393

Merged
merged 6 commits into from
Sep 26, 2023
Merged

Conversation

garrettmflynn
Copy link
Member

This PR relies on Python instead of JavaScript to handle expected NaN values in the JSON metadata (unlike #374).

Instead of allowing non-compliant JSON on the browser (which doesn't work when passing the object back to Python), this approach replaces None values where numbers are expected with NaN on the Python side, while converting NaN values to None before passing to JavaScript.

Since this is primarily testing Ophys interfaces (#177), the Ophys metadata field is ignored in this PR so we can work on those interactions in a follow-up (related to #176).

@CodyCBakerPhD
Copy link
Collaborator

Much less hacky than eval; nice solution

@CodyCBakerPhD CodyCBakerPhD merged commit 2e0e150 into main Sep 26, 2023
@CodyCBakerPhD CodyCBakerPhD deleted the fix-ophys-json branch September 26, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants